import 'package:flutter/material.dart';
import 'package:untitled9/page.dart';
import 'package:untitled9/profile_page.dart';

import 'choosehouse.dart';

class HouseManagementPage extends StatefulWidget {
  const HouseManagementPage({super.key});

  @override
  State<HouseManagementPage> createState() => _HouseManagementPageState();
}

class _HouseManagementPageState extends State<HouseManagementPage> {
  @override
  Widget build(BuildContext context) {
    double scrW = MediaQuery.of(context).size.width;
    double scrH = MediaQuery.of(context).size.height;
    return Scaffold(
      appBar: AppBar(
        leading: GestureDetector(
            onTap: () {
              Navigator.push(context, MaterialPageRoute(builder: (context) {
                return Page1();
              }));
            },
            child: Center(
                child: Text(
              'back',
              style: TextStyle(color: Colors.white),
            ))),
        automaticallyImplyLeading: false,
        backgroundColor: Color.fromRGBO(195, 161, 162, 1.0),
        title: Center(
            child: Text(
          'House Management',
          style: TextStyle(color: Colors.white),
        )),
        actions: [
          SizedBox(
            width: 50,
          )
        ],
      ),
      body: Stack(
        children: [
          Positioned(
            top: 300,
            child: Container(
              width: scrW,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Text(
                    'No House',
                    style: TextStyle(fontSize: 30),
                  ),
                  Text('Click the button below to add a house')
                ],
              ),
            ),
          ),
          Positioned(
            bottom: 20,
            right: 20,
            child: GestureDetector(
              onTap: () {
                Navigator.push(context, MaterialPageRoute(builder: (context) {
                  return ChooseHouse();
                }));
              },
              child: Container(
                width: 70,
                height: 70,
                child: Center(
                  child: Text(
                    '+',
                    style: TextStyle(fontSize: 30),
                  ),
                ),
                decoration: BoxDecoration(
                    border: Border.all(width: 1, color: Colors.grey),
                    borderRadius: BorderRadius.circular(35)),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
